package JavaSE.d5;

import java.io.*;
import java.nio.file.Path;

public class Test27 {
    public static void main(String[] args) throws IOException {
        Path p= Path.of("log.txt");
        p=p.toAbsolutePath();

        FileReader fileReader = new FileReader(p.toFile());
        BufferedReader bufferedReader = new BufferedReader(fileReader);

        String s = bufferedReader.readLine();
        String[] split = s.split(",");
        int num=0;
        for (String s1 : split) {
            while (s1.endsWith(".jar")){
                num++;
                System.out.println(s1);
                break;
            }
        }
        System.out.println("jar包个数:"+num);
        bufferedReader.close();
        fileReader.close();
    }
}
